function hDeploy = getDeployFunc(net_name, net_param)

if isempty(net_name) || strcmpi(net_name, 'I')
    hDeploy = @(X) X;
    return
end

if strcmpi(net_name, 'Bicubic')
    error('xxxxx');
    hDeploy = imresize(y, net_param, 'Bicubic');
    return
end

if nargin < 2, net_param = ''; end

%%
hDeploy = get_deploy(net_name, net_param);

%%
[border_size, block_size] = srmodel.get_blocksize(net_name);

%%
hDeploy = @(X) srmodel.deploy(X, hDeploy, block_size, border_size);

function hDeploy = get_deploy(net_name, net_param)

net_name = upper(net_name);

% {'VDSR03', 'VDSR18', 'VDSR1', 'VDSR2', 'VDSR3'}
if str(net_name).isbeginwith('VDSR') && ~strcmp(net_name, 'VDSR0')
    hDeploy = VDSR.getDeployNet(net_name, net_param);
    return
end

switch net_name
    case 'SRCNN'
        hDeploy = @(X) SRCNN.deploy(X, net_param);
    case 'SRCNN_BATCH'
        hDeploy = @(X) SRCNN.deploy_batch(X, net_param);
    case 'FSRCNN'
        hDeploy = @(X) FSRCNN.deploy(X, net_param);
    case 'FSRCNN_BATCH'
        hDeploy = @(X) FSRCNN.deploy_batch(X, net_param);
    case 'VDSR0'
        % vl_setupnn;
        hDeploy = VDSR0.getDeployFunc(mycaffe.useGPU);
    case 'VDSR+'
        % [DeployFile, CaffeModel] = VDSR.getDeployNet2(net_param);
    case 'RED'
        [DeployFile, CaffeModel] = RED.getDeployNet(net_param);
        hDeploy = @(imlow) imlow + squeeze(mycaffe.caffe(imlow, DeployFile, CaffeModel, 'test'));
    otherwise
        hfunc = sprintf('%s.getDeployNet(%d)', net_name, net_param);
        [DeployFile, CaffeModel] = eval(hfunc);
        hDeploy = @(imlow) mycaffe.caffe(imlow, DeployFile, CaffeModel, 'test');
end
